package com.dy.分类.链表;

public class ListNode {
    public int val;
    public ListNode next;
    public ListNode(int x) { val = x; }

    public void display(){
        ListNode p = this;
        while(p!=null){
            System.out.print(p.val+" ");

            p=p.next;
        }
        System.out.println();
    }
}
